<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/common/taglibs.jsp"%>
<!DOCTYPE html>
<html class="ng-app:myApp" id="ng-app" ng-app="myApp" xmlns:ng="http://angularjs.org">
<head>
<title>回单管理</title>
<%@ include file="/WEB-INF/common/meta.jsp"%>
<%@ include file="/WEB-INF/layouts/global_res_header.jsp"%>
</head>

<body ng-controller="orderMonitorCtrl">
	<div id="mainDataBlock" ng-grid="gridOptions"></div>

	<div id="funcBlock" class="alert alert-info">
		<div class="btn-group btn-group-sm">
			<button type="button" class="btn btn-default" ng-click="onOpenQueryFormModal()">
				<span class="glyphicon glyphicon-search"></span> 查询
			</button>
			<button type="button" class="btn btn-default" ng-click="refresh()" id="bt">
				<span class="glyphicon glyphicon-refresh"></span> 刷新
			</button>
		</div>
	</div>
</body>

<div id="queryFormModal" class="modal" tabindex="-1" data-width="450px" style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">查询</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="queryFormForm" class="form-inline" role="form">	
					<div class="form-group" style="margin-left: 24px">
						<label for="name">客户</label> 
						<select name="clientId" ui-select2="{width:'150px', allowClear:'true'}" ng-model="queryForm.clientId" style="width: 100%;" class="select2" data-placeholder="承运商">
							<option value=""></option>
							<option value=""></option>
							<option ng-repeat="client in clientList" value="{{client.id}}">{{client.shortName}}</option>
						</select>					</div>								
					<div class="form-group">
						<label for="st">订单编号</label>
						<input style="width:150px;" type="text" name="orderCd" ng-model="queryForm.orderCd" class="form-control" placeholder="名称">		
					</div>
					<div class="form-group">
						<label for="name">回单编号</label> 
						<input style="width:150px;margin-top: 5px" type="text" name="cd" ng-model="queryForm.cd" class="form-control" placeholder="名称">		
					</div>								
					<div class="form-group">
						<label for="st">调度单号</label>
						<input style="width:150px;margin-top: 5px" type="text" name="shipmentCd" ng-model="queryForm.shipmentCd" class="form-control" placeholder="名称">		
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button ng-click="onQuery()" ng-disabled="queryFormForm.$invalid" class="btn btn-default">查询</button>
	</div>
</div>

<div id="editFormModal" class="modal" tabindex="-1" data-width="500px" style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">编辑</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="editFormForm" class="form-horizontal" role="form" novalidate>
					<div class="form-group hidden">
						<label for="id" class="col-sm-4 control-label">ID</label> 
						<div class="col-sm-5">
							<input type="hidden" name="id" ng-model="editForm.id" class="form-control">		
						</div>
					</div>
					<div class="form-group">
						<label for="platformId" class="col-sm-4 control-label">平台</label> 
						<div class="col-sm-5">
							<input type="text" name="platformId" ng-model="editForm.platformId" required class="form-control" placeholder="所属平台">		
						</div>
					</div>
					<div class="form-group">
						<label for="clientId" class="col-sm-4 control-label">客户</label> 
						<div class="col-sm-5">
							<input type="text" name="clientId" ng-model="editForm.clientId" required class="form-control" placeholder="客户">		
						</div>
					</div>
					<div class="form-group">
						<label for="orderId" class="col-sm-4 control-label">订单</label> 
						<div class="col-sm-5">
							<input type="text" name="orderId" ng-model="editForm.orderId" required class="form-control" placeholder="订单">		
						</div>
					</div>
					<div class="form-group">
						<label for="legsId" class="col-sm-4 control-label">分段订单</label> 
						<div class="col-sm-5">
							<input type="text" name="legsId" ng-model="editForm.legsId" required class="form-control" placeholder="分段订单">		
						</div>
					</div>
					<div class="form-group">
						<label for="descr" class="col-sm-4 control-label">描述</label> 
						<div class="col-sm-5">
							<input type="text" name="descr" ng-model="editForm.descr" class="form-control" placeholder="描述">		
						</div>
					</div>
					<div class="form-group">
						<label for="st" class="col-sm-4 control-label">状态</label> 
						<div class="col-sm-5">
							<select name="st" ng-required="true" ng-model="editForm.st" class="form-control" data-placeholder="状态">
								<option value=""></option>
								<option ng-repeat="st in stList" value="{{st.id}}">{{st.lb}}</option>
							</select>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button ng-click="onSaveEditForm()" ng-disabled="editFormForm.$invalid" class="btn btn-default">提交</button>
	</div>
</div>

<div id="returnModal" class="modal" tabindex="-1" data-width="400px" style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">返单确认</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="editRtForm" class="form-horizontal" role="form" novalidate>
					<div class="form-group">
						<label for="backDt" class="col-sm-4 control-label"><span style="font-size: 18px;color:red">*</span>返单时间</label> 
						<div class="col-sm-5">
							<input type="text" name="backDt" style="margin-top: 5px" ng-model="editFormRt.backDt" required class="form-control" placeholder="客户">		
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button ng-click="receipt()" ng-disabled="editRtForm.$invalid" class="btn btn-default">提交</button>
	</div>
</div>

<div id="nntModal" class="modal" tabindex="-1" data-width="400px" style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">延时单确认</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="editNntForm" class="form-horizontal" role="form" novalidate>
					<div class="form-group">
						<label for="reason" class="col-sm-4 control-label">延时确认</label> 
						<div class="col-sm-5">
							<input type="text" name="reason" style="width: 200px;height: 200" ng-model="editFormNnt.reason" class="form-control" placeholder="客户">		
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button ng-click="nntConfirm()" ng-disabled="editNntForm.$invalid" class="btn btn-default">提交</button>
	</div>
</div>


<div id="checkModal" class="modal" tabindex="-1" data-width="900px" style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">回单登记</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="editFormCkForm" role="form" novalidate>
					<input type="hidden" name="id" ng-model="editFormCk.id"
						class="form-control">
					<div class="row">
						<div class="col-sm-4">
							<div style="width:70px;float: left;font-size: 12px;padding-left: 16px;"><span style="font-size: 18px;color:red">*</span>订单号</div>
							<input type="text" style="width: 150px;" name="orderCd" ng-model="editFormCk.orderCd" required class="form-control" placeholder="标识">
						</div>
						<div class="col-sm-4">
							<div style="width:70px;float: left;font-size: 12px;padding-left:4px;"><span style="font-size: 18px;color:red">*</span>回单编号</div>
							<input type="text" style="width: 150px;;" name="cd" ng-model="editFormCk.cd" required class="form-control" placeholder="名称">
						</div>
					
						<div class="col-sm-4">
							<div style="width:70px;float: left;font-size: 12px;padding-left: 10px;"><span style="font-size: 18px;color:red">*</span>签单人</div>
							<input type="text" style="width: 150px;" name="signMan" ng-model="editFormCk.signMan" required class="form-control" placeholder="缩写">
						</div>
					</div>
					<div class="row">		
					<div class="col-sm-4">
							<div style="width:70px;float: left;font-size: 12px;padding-top:12px;padding-left: 10px;">签单时间 </div>
							<input type="text" style="width: 150px;margin-top: 5px" name="writeDt" ng-model="editFormCk.writeDt" required class="form-control" placeholder="缩写">
						</div>
						<div class="col-sm-4">
							<div style="width:70px;float: left;font-size: 12px;padding-top:4px;padding-left: 4px;"><span style="font-size: 18px;color:red">*</span>回单时间</div>
							<input type="text" style="width: 150px;margin-top: 5px" name="receiptDt" ng-model="editFormCk.receiptDt" required class="form-control" placeholder="缩写">
						</div>
						<div class="col-sm-4">
							<div style="width:70px;float: left;font-size: 12px;padding-top:4px;padding-left: 3px;margin-top: 7px;">回单状态</div>
							<select name="status" ui-select2="{width:'150px', allowClear:'true'}"  ng-model="editFormCk.status"  style="width: 100%;margin-top: 5px" class="select2" data-placeholder="回单状态">								<option value=""></option>
								<option ng-repeat="status in statusList" value="{{status.descr}}">{{status.val}}</option>
							</select>
						</div>
					</div>
					<div class="row">
						<div class="col-sm-4" style="width: 100%">
						<div style="width:70px;float: left;font-size: 12px;padding-top:4px;padding-left: 32px;margin-top: 7px;">备注</div>
							<input type="text" style="width: 755px; margin-top: 5px" name="descr" ng-model="editFormCk.descr" class="form-control" placeholder="电话">
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button ng-click="check()" ng-disabled="editCkForm.$invalid" class="btn btn-default">提交</button>
	</div>
</div>

<div class="contextMenu" id="menu">
	<ul>
		<li id="find" ng-click="onOpenQueryFormModal()">
		 <img src="" width="17" height="17"/> 
		查询</li>
		<li id="refresh" ng-click="refresh()">
		 <img src="" width="17" height="17"/> 
		刷新</li>
		<li id="return" ng-click="orderReturn()">
		 <img src="" width="17" height="17"/> 
		已返还</li>
		<li id="nnt" ng-click="onOpenNntConfirmModal()">
		 <img src="" width="17" height="17"/> 
		未按时返还</li>
	</ul>
</div>

<%@ include file="/WEB-INF/layouts/global_res_footer.jsp"%>
<script type="text/javascript" src="${ctx}/res_oms/oms/orderMonitor.js"></script>
<script type="text/javascript" src="${ctx}/res_oms/drag.js"></script> 
<script type="text/javascript" src="${ctx}/res_oms/jquery.contextmenu.r2.js"></script>
</html>
